feat: support void method optimization in Java pipeline#1980
feat: support void method optimization in Java pipeline#1980HeshamHM28 wants to merge 4 commits intomainfrom
Conversation
Discover void methods, instrument them by serializing the receiver instead of a return value, and treat all-null comparisons as equivalent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @HeshamHM28's task in 7m 40s —— View job PR Review Summary
Prek Checks
Code ReviewBug: Method-call receivers are re-evaluated inside the serialize call
is_static_call = receiver != "this" and receiver[:1].isupper()
parts: list[str] = []
if not is_static_call:
parts.append(receiver)
parts.extend(arg_texts)
if parts:
serialize_target = f"new Object[]{{{', '.join(parts)}}}"
container.getItems().sort(data);
_cf_serializedResult = serialize(new Object[]{container.getItems(), data});
SomeType _cf_recv = container.getItems();
_cf_recv.sort(data);
serialize(new Object[]{_cf_recv, data});This is a real correctness issue for non-trivial receiver expressions. Simple local-variable receivers ( Design:
|
⚡️ Codeflash found optimizations for this PR📄 25% (0.25x) speedup for
|
…2026-04-03T13.47.39 ⚡️ Speed up method `JavaAssertTransformer._generate_replacement` by 25% in PR #1980 (`cf-java-void-optimization`)
|
This PR is now faster! 🚀 @claude[bot] accepted my optimizations from: |
…id method state tests
10cfedf to
3bc4941
Compare
Summary
InPlaceSorter.bubbleSortInPlace(arr)), serialize the arguments instead of the class name, which is not a value and can't be cast to Objectsorter.bubbleSortInPlace(arr)), serialize the receiver object to capture side effects